<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<body>
<form class="layui-form layui-form-pane" id="operatePage">
    <div class="page-title"><div class="page-title-con"><span>新建文件夹</span><div class="move_title"></div><?php include "../public/sub.php";?></div></div>
    <div class="main-container">
        <div class="layui-form-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md12">
                    <label class="layui-form-label"><text>*</text>名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" id="name" placeholder="请输入" clearable autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<script>
    var param_pid = getQueryVariable('pid') || 0;
    var param_enginid = getQueryVariable('enginid') || 0;

    $("#operatePage").validate({
        rules: {
            name: {required: true},
        },
        messages:{
            name: {required: "请输入"},
        }
    });

    layui.use(['laytp', 'form', 'table'], function() {
        var form = layui.form, layer = layui.layer,table = layui.table;
        render_input_attr();


        form.on('submit(add)', function(data){
            var validRes = $("#operatePage").valid();
            if(!validRes){return false;}

            data.field.pid = param_pid;
            data.field.enginid = param_enginid;
            facade.ajax({url: ask_engin_fold_addjia, data:data.field}).done(function(res){
                if (res.code === 2000) {
                    parent.searchTableFunc(form, table);
                    dataPostTimeOut();
                }
            });

            return false;
        });

    });



</script>
</body>
</html>
